package com.ethink.warehouse.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.warehouse.api.info.MatePurchaseCodeInfo;
import com.ethink.warehouse.api.request.MatePurchaseCodeQueryRequest;
import com.ethink.warehouse.api.request.MatePurchaseCodeUpdateRequest;
import com.ethink.warehouse.api.response.MatePurchaseCodeGetDetailResponse;
import com.ethink.warehouse.api.response.MatePurchaseCodeQueryResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 库存采购批次表 Facade接口
 *
 * @author default
 * @date 2022-12-16
 */
@FeignClient(name = "ethink-warehouse-service", path = "warehouse-service/facade/v1/matePurchaseCode", contextId = "matePurchaseCodeFacade")
public interface MatePurchaseCodeFacade {

    @GetMapping("/getMatePurchaseCodeByProduceCode")
    @ResponseBody
    MatePurchaseCodeInfo getMatePurchaseCodeByProduceCode(@RequestParam("mateSku") String mateSku,
                                                          @RequestParam("produceCode") String produceCode);
    @PostMapping("/getMatePurchaseCodeListByProduceCode")
    @ResponseBody
    List<MatePurchaseCodeInfo> getMatePurchaseCodeListByProduceCode(@RequestParam("mateSku") String mateSku,
                                                                    @RequestParam("excludeProduceCode") String excludeProduceCode);

    @PostMapping("/queryMatePurchaseCode")
    @ResponseBody
    Page<MatePurchaseCodeQueryResponse> queryMatePurchaseCode(@RequestBody MatePurchaseCodeQueryRequest request);

    @PostMapping("/getMatePurchaseCodeById")
    @ResponseBody
    MatePurchaseCodeGetDetailResponse getMatePurchaseCodeById(@RequestParam("matePurchaseCodeId") Long matePurchaseCodeId);

    @PostMapping("/updateMatePurchaseCode")
    @ResponseBody
    void updateMatePurchaseCode(@RequestBody MatePurchaseCodeUpdateRequest request);


}